package composite;

import java.util.HashMap;
import java.util.Map;

public class Client {

    public static void main(String[] args) {

        //从大到小创建组织
        //创建学校
        OrganizationComponent university = new University("清华大学","中国顶级学校");
        //创建学院
        OrganizationComponent computerCollege = new College("计算机学院","计算机学院");
        OrganizationComponent inforCollege = new College("信息工程学院","信息工程学院");
        //创建系,叶子节点，添加方法
        computerCollege.add(new Department("软件工程","不错"));
        Department interDepartment = new Department("网络工程", "一般");
        computerCollege.add(interDepartment);
        computerCollege.add(new Department("计算机科学与技术","很好"));

        inforCollege.add(new Department("通信工程","难学"));
        inforCollege.add(new Department("信息工程","简单"));

        //将学院加到学校中
        university.add(computerCollege);
        university.add(inforCollege);

        //整体学校输出,找到University类中的print方法：
        university.print();

        //学院输出
        computerCollege.remove(interDepartment);
        computerCollege.print();
        inforCollege.print();

    }


}
